<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://xmlns.jcp.org/jsf/html"
	xmlns:f="http://xmlns.jcp.org/jsf/core"
	xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
	xmlns:c="http://xmlns.jcp.org/jsf/composite"
	xmlns:p="http://primefaces.org/ui">
<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta http-equiv="Pragma" content="no-cache" />
	<meta http-equiv="Expires" content="-1" />
	<title>ST Manager</title>
	<link href="imagem/favicon.png" type="image/png" rel="shortcut icon" />
	<link type="text/css" rel="stylesheet"
		href="#{request.contextPath}/css/skytef.css" />
</h:head>
<h:body>
	<ui:include src="header.xhtml" />
	<p:ajaxStatus style="width:100px;height:100px;" id="ajaxStatusPanel">
		<f:facet name="start">
			<h:graphicImage value="imagem/loadingPrime.gif" />
		</f:facet>

		<f:facet name="complete">
			<h:outputText value="" />
		</f:facet>
	</p:ajaxStatus>
	<div class="central">
		<h:form id="form">
			<p:panel id="conteudo" header="Informações da Tarefa: "
				style="width: 123.5%;">
				<p:messages />
				<h:outputText value="Nº Tarefa: OCR #{TarefaBean.tarefa.id}" />
				<h:panelGrid id="displaya" columns="8">
					<h:outputText value="CNPJ/Razão Social/Id Skytef: "
						style="font-size: 14px;font-weight:bold;" />
					<p:inputText id="maskcnpj" value="#{TarefaBean.textoConsulta}"
						required="true" requiredMessage="Cliente obrigatório" />
					<div style="text-align: right">
						<p:commandButton ajax="false" value="Abrir Tarefa"
							icon="ui-icon-plus" update="form:clientePanel"
							actionListener="#{TarefaBean.localizar}" style="font-size: 14px;" />
					</div>
				</h:panelGrid>

			</p:panel>
			<p:dialog header="Cadastro de Contato" widgetVar="clienteDialog"
				resizable="false" id="clienteDlg" showEffect="fade"
				hideEffect="explode" modal="true">
				<h:panelGrid columns="2" cellpadding="4">
					<h:outputText value="Nome: "
						style="font-size: 14px;font-weight:bold; " />
					<h:inputText value="#{ContatoBean.nome}"
						style="font-weight:bold; font-size: 14px;" />
					<h:outputText value="Telefone: "
						style="font-size: 14px;font-weight:bold;" />
					<p:inputText value="#{ContatoBean.telefone}"
						style="font-weight:bold; font-size: 14px; " />
					<h:outputText value="Email: "
						style="font-size: 14px;font-weight:bold;" />
					<p:inputText value="#{ContatoBean.email}"
						style="font-weight:bold; font-size: 14px; " />
					<p:commandButton ajax="false" value="Salvar" icon="ui-icon-plus"
						update="form:clientePanel"
						actionListener="#{ContatoBean.cadastro}" style="font-size: 14px;" />
				</h:panelGrid>
			</p:dialog>


			<p:dialog header="Cadastro de Motivo" widgetVar="motivoDialog"
				resizable="false" id="motivoDlg" showEffect="fade"
				hideEffect="explode" modal="true">
				<h:panelGrid columns="2" cellpadding="4">
					<h:outputText value="Motivo: "
						style="font-size: 14px;font-weight:bold; " />
					<h:inputText value="#{TarefaBean.motivo}"
						style="font-weight:bold; font-size: 14px;">
						<f:validateLength minimum="5" />
					</h:inputText>
					<p:commandButton value="Cadastrar" icon="ui-icon-plus"
						update="form:clientePanel" ajax="false"
						actionListener="#{TarefaBean.cadastrarMotivo}"
						style="font-size: 14px;" />
				</h:panelGrid>
			</p:dialog>

			<p:panel resizable="false" id="clientePanel"
				visible="#{TarefaBean.atendimento}"
				style="width: 123.5%; margin-top:10px;" ajax="false">
				<div style="text-align: right">
					<p:clock pattern="HH:mm:ss" mode="server" style="width:20%" />
				</div>
				<h:panelGrid id="display" columns="10" cellpadding="4">
					<h:outputText value="Razão Social: "
						style="font-size: 14px;font-weight:bold;" />
					<h:outputText value="#{TarefaBean.cliente.razaoSocial}"
						style="font-weight:bold; font-size: 14px; " />
					<h:outputText value="Revenda: "
						style="font-size: 14px;font-weight:bold;" />
					<h:outputText value="#{TarefaBean.parceiro.razaoSocial}"
						style="font-weight:bold; font-size: 14px;" />
					<h:outputText value="Software House: "
						style="font-size: 14px;font-weight:bold;" />
					<h:outputText value="#{TarefaBean.sftHouse.nome}"
						style="font-weight:bold; font-size: 14px; " />
				</h:panelGrid>
				<p:separator id="separator" />

				<h:panelGrid columns="10" cellpadding="4">
					<h:outputText value="Contato: "
						style="font-size: 14px; font-weight:bold;" />
					<p:selectOneMenu value="#{TarefaBean.tarefa.contato_id}">
						<f:selectItems value="#{TarefaBean.contatos}" var="contatos"
							itemLabel="#{contatos.nome}" itemValue="#{contatos.contatoId}"
							style="font-size: 10px;" />
					</p:selectOneMenu>
					<p:commandButton icon="ui-icon-plus" update="form:clientePanel"
						oncomplete="PF('clienteDialog').show()"
						actionListener="#{TarefaBean.cadContato}" style="font-size: 14px;"
						global="false" />

					<h:outputText value="Produto: "
						style="font-size: 14px; font-weight:bold;" />
					<p:selectOneMenu>
						<f:selectItems value="#{TarefaBean.prodCliente}" var="prodCliente"
							itemLabel="#{prodCliente.nomeProduto}"
							itemValue="#{prodCliente.produto_id}" style="font-size: 10px;" />
					</p:selectOneMenu>

					<h:outputText value="Tipo Vpn:"
						style="font-size: 14px; font-weight:bold;" />
					<p:selectOneMenu>
						<f:selectItems value="#{TarefaBean.prodCliente}"
							var="prodClientes" itemLabel="#{prodCliente.tipoVpn}"
							itemValue="#{prodClientes.produto_id}" style="font-size: 10px;" />
					</p:selectOneMenu>

				</h:panelGrid>
				<h:panelGrid columns="10" cellpadding="4">
					<h:outputText value="Motivo Suporte: "
						style="font-size: 14px; font-weight:bold;" />

					<p:selectOneMenu value="#{TarefaBean.tarefa.motivoSuporte_id}">
						<f:selectItems
							value="#{TarefaBean. getListMotivoSuporteEntities()}" var="mot"
							itemLabel="#{mot.motivo}" itemValue="#{mot.id}"
							style="font-size: 10px;" />
					</p:selectOneMenu>
					<p:commandButton icon="ui-icon-plus" update="form:motivoDlg"
						oncomplete="PF('motivoDialog').show()" style="font-size: 14px;" />

					<h:outputText value="Subcategorias de Erros: "
						style="font-size: 14px; font-weight:bold;" />
					<p:selectOneMenu value="#{TarefaBean.tarefa.suberro_id}">
						<f:selectItems value="#{TarefaBean. getListSubErroEntities()}"
							var="erro" itemLabel="#{erro.nome}" itemValue="#{erro.id}"
							style="font-size: 10px;" />
					</p:selectOneMenu>

				</h:panelGrid>


				<h:panelGrid columns="6" cellpadding="4" style="margin:0 auto;">
					<h:outputText value=" Tipo Cliente: "
						style="font-size: 14px;font-weight:bold;" />
					<p:selectOneMenu id="tipoCliente" style="font-size: 12px;"
						value="#{TarefaBean.tarefa.tipoCliente}">
						<f:selectItem itemLabel="Cliente" itemValue="Cliente" />
						<f:selectItem itemLabel="Revenda" itemValue="Revenda" />
					</p:selectOneMenu>
					<h:outputText value=" Forma: "
						style="font-size: 14px; font-weight:bold;" />
					<p:selectOneMenu value="#{TarefaBean.tarefa.forma}"
						style="font-size: 12px">
						<f:selectItem itemLabel="Acesso Remoto" itemValue="acesso remoto" />
						<f:selectItem itemLabel="Telefônico" itemValue="Telefonico" />
						<f:selectItem itemLabel="A/T" itemValue="A/T" />
					</p:selectOneMenu>
					<h:outputText value=" Tipo de Suporte: "
						style="font-size: 14px; font-weight:bold;" />
					<p:selectOneMenu id="tipoSuporte" style="font-size: 12px;"
						value="#{TarefaBean.tarefa.tipoSuporte}">
						<f:selectItem itemLabel="Instalação" itemValue="Instalacao" />
						<f:selectItem itemLabel="Atendimento" itemValue="Atendimento" />
						<f:selectItem itemLabel="Skype" itemValue="Skype" />
						<f:selectItem itemLabel="Email" itemValue="Email" />
					</p:selectOneMenu>
				</h:panelGrid>

				<h:panelGrid columns="4" cellpadding="4">
					<h:outputText value="Descrição do Atendimento: "
						style="font-size: 14px;font-weight:bold;" />
					<p:inputTextarea rows="10" cols="80"
						style="font-size: 14px;width:150%"
						value="#{TarefaBean.tarefa.descricao}" />
				</h:panelGrid>
				<h:panelGrid columns="4" cellpadding="4" style="margin-left:85%">
					<h:outputText value="Status: "
						style="font-size: 14px;font-weight:bold;" />
					<p:selectOneMenu id="status" style="font-size: 14px;"
						value="#{TarefaBean.tarefa.status}">
						<f:selectItem itemLabel="Pendente" itemValue="P" />
						<f:selectItem itemLabel="Concluído" itemValue="C" />
					</p:selectOneMenu>
				</h:panelGrid>

				<div style="margin-top: 14px; text-align: right">
					<p:commandButton id="btSalvar" value="Salvar"
						style="font-size: 14px;" image="ui-icon-disk" ajax="false"
						actionListener="#{TarefaBean.salvar}" />
					<p:commandButton id="btLimpar" value="Limpar"
						style="font-size: 14px;" image="ui-icon-disk" ajax="false"
						actionListener="#{TarefaBean.limpar}" update="form:btLimpar" />
				</div>
			</p:panel>
		</h:form>
	</div>

	<p:panel id="cm" style="background: transparent; border: 0px;">
		<ui:include src="#{DashboardBean.currentMenu}" />
	</p:panel>

	<p:panel id="cr"
		style="background: transparent; border: 0px;margin-top:55%;text-align:center">
		<h:outputLabel
			value="© 2002-2013 Skytef - Todos os direitos reservados"
			style="font-size: xx-small;" />
	</p:panel>

</h:body>
</html>

